import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by loso on 2017/3/6.
 */
public class _506_RelativeRanks {
    public static void main(String[] args) {

    }

    public String[] findRelativeRanks(int[] nums) {
        Map<Integer,String> map = new HashMap<Integer, String>();
        for (int a :
                nums) {
            map.put(a,"");
        }
        int[] oldnums = new int[nums.length];
        for (int i = 0; i < nums.length; i++) {
            oldnums[i] = nums[i];
        }
        Arrays.sort(nums);
        map.put(nums[nums.length-1],"Gold Medal");
        if (nums.length > 1)
            map.put(nums[nums.length-2],"Silver Medal");
        if (nums.length > 2)
            map.put(nums[nums.length-3],"Bronze Medal");
        if (nums.length > 3)
        for (int i = nums.length-4; i >= 0 ; i--) {
            map.put(nums[i],(nums.length - i) + "");
        }
        String[] s = new String[nums.length];
        for (int i = 0; i < nums.length; i++) {
            s[i] = map.get(oldnums[i]);
        }
        return s;
    }
}
